package org.shop.goods.feign;


import com.github.pagehelper.PageInfo;
import org.shop.common.pojo.Result;
import org.shop.goods.pojo.Sku;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("goods")
@RequestMapping("/sku")
public interface SkuFeign {

    @GetMapping
    public Result<List<Sku>> findAll();

    @RequestMapping("/search/{page}/{size}")
    Result<PageInfo> search(@RequestBody(required = false) Sku sku, @RequestParam("page") Integer page, @RequestParam("size") Integer size);
}
